    <meta charset="utf-8">
    <title>货币列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="description" content="网站描述">
    <meta name="keywords" content="">
    <meta name="author" content="wangl">
    <link rel="icon" href="http://ow9lg82yy.bkt.clouddn.com/24f5c360-485d-4a6d-9468-2a61c353cf37.ico">
    <link rel="stylesheet" href="/static/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="//at.alicdn.com/t/font_tnyc012u2rlwstt9.css" media="all">
    <link rel="stylesheet" href="/static/css/user.css" media="all">
    <link rel="stylesheet" href="/static/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        #ele{padding: 20px}
        .clearfix::after {
            content: ".";
            clear: both;
            display: block;
            overflow: hidden;
            font-size: 0;
            height: 0;
        }
        .clearfix {
            zoom: 1;
        }

        .Pagination ul{
            list-style: none;
        }
        .Pagination .total_num,.first_page,.prepage,.list_box,.nextpage,.last_page,.total_page,input,.redir {
            float: left;
        }
        .Pagination ul li {
            float: left;
            background-color: #ccc;
            border-radius: 5px;
            text-align: center;
            line-height: 22px;
            width: 22px;
            height: 22px;
            font-size: 12px;
            margin: 0 5px;
            cursor: pointer;
            color: #8b8b8b
        }
        .Pagination ul li:hover {
            background-color: #58acf4;
            color: #fff;
        }
        .Pagination .total_num {
            margin: 0 5px;
        }
        .Pagination .total_num i {
            font-style: normal;
        }
        .Pagination .list_box {
            width: 320px;
            overflow: hidden;
            position: relative;
            height: 32px;
        }
        .Pagination .list_box ul {
            position: absolute;
            top: 0;
            left: 0;
        }
        .Pagination .prepage {
            background-color: #ccc;
            border-radius: 5px;
            padding: 3px 10px;
            font-size: 12px;
            margin: 0 5px;
            cursor: pointer;
            color: #8b8b8b
        }
        .Pagination .prepage:hover {
            background-color: #58acf4;
            color: #fff;
        }
        .Pagination .nextpage {
            background-color: #ccc;
            border-radius: 5px;
            padding: 3px 10px;
            font-size: 12px;
            margin: 0 5px;
            cursor: pointer;
            color: #8b8b8b
        }
        .Pagination .nextpage:hover {
            background-color: #58acf4;
            color: #fff;
        }
        .Pagination .first_page {
            background-color: #ccc;
            border-radius: 5px;
            padding: 3px 10px;
            font-size: 12px;
            margin: 0 5px;
            cursor: pointer;
            color: #8b8b8b
        }
        .Pagination .first_page:hover {
            background-color: #58acf4;
            color: #fff;
        }
        .Pagination .last_page {
            background-color: #ccc;
            border-radius: 5px;
            padding: 3px 10px;
            font-size: 12px;
            margin: 0 5px;
            cursor: pointer;
            color: #8b8b8b
        }
        .Pagination .last_page:hover {
            background-color: #58acf4;
            color: #fff;
        }
        .Pagination .redir {
            background-color: #58acf4;
            color: #fff;
            border-radius: 5px;
            padding: 3px 10px;
            font-size: 14px;
            cursor: pointer;
        }
        .Pagination .redir:hover {
            opacity: 0.8;
        }
        .Pagination input {
            width: 50px;
            height: 25px;
            border-radius: 5px;
            border: 1px solid #ccc;
            outline: none;
            text-indent: 5px;
            margin: 0 5px;
        }
        .Pagination .short {
            background-color: #fff;
            cursor: default;
        }
        .Pagination .short:hover {
            background-color: #fff;
            color: #8b8b8b;
        }
        .Pagination_active {
            background-color: #58acf4 !important;
            color: #fff !important;
        }
        .detail-body {
            margin: 20px 0 0;
            min-height: 306px;
            line-height: 26px;
            font-size: 16px;
            color: #333;
            word-wrap: break-word;
        }

        /* blockquote 样式 */
        blockquote {
            display: block;
            border-left: 8px solid #d0e5f2;
            padding: 5px 10px;
            margin: 10px 0;
            line-height: 1.4;
            font-size: 100%;
            background-color: #f1f1f1;
        }

        /***
        *  ztree 图标变成黄色
        */
        .ztree .line {
            line-height: 0;
            border-top: none;
            float: none;
        }

        .ztree li span.button.ico_docu {
            background-position: -110px 0;
            margin-right: 2px;
            vertical-align: top;
        }

        /* code 样式 */
        code {
            display: inline-block;
            *display: inline;
            *zoom: 1;
            background-color: #f1f1f1;
            border-radius: 3px;
            padding: 3px 5px;
            margin: 0 3px;
        }

        pre code {
            display: block;
        }
        .layui-table-cell{ padding: 0 5px;}
    </style>


</head>
<body class="childrenBody">
<div >
    <#--class="layui-col-xs12"-->
    <fieldset class="layui-elem-field ">
        <legend>货币列表</legend>
        <div class="layui-inline">
            <a href="/back/dealparam/coinType/addpage" class="layui-btn layui-btn-normal" data-type="addUser">添加货币</a>
        </div>
    </fieldset>

    <div class="layui-form users_list">

                        <#--class="layui-table-header"-->
                        <table cellspacing="0" cellpadding="0" border="0" class="layui-table">
                            <thead>
                            <tr>
                                <!-- 编号、货币图标、货币名称、货币单价、已配发、已激活、已释放、已冻结、已回购、已交易、今日交易、创建时间、操作 -->
                                <th data-field="anid">
                                    <div class="layui-table-cell laytable-cell-1-anid"><span>编号</span></div>
                                </th>
                                <th data-field="title">
                                    <div class="layui-table-cell laytable-cell-1-content"><span>货币图标</span></div>
                                </th>
                                <th data-field="content">
                                    <div class="layui-table-cell laytable-cell-1-content"><span>货币名称</span></div>
                                </th>
                                <th data-field="link">
                                    <div class="layui-table-cell laytable-cell-1-content"><span>货币单价</span></div>
                                </th>
                                <th data-field="publistTime" data-unresize="true">
                                    <div class="layui-table-cell laytable-cell-1-content"><span>已配发</span></div>
                                </th>
                                <#--<th data-field="publistTime" data-unresize="true">-->
                                    <#--<div class="layui-table-cell laytable-cell-1-publistTime"><span>已配发</span></div>-->
                                <#--</th>-->
                                <th data-field="publistTime" data-unresize="true">
                                    <div class="layui-table-cell laytable-cell-1-content"><span>已激活</span></div>
                                </th>
                                <th data-field="publistTime" data-unresize="true">
                                    <div class="layui-table-cell laytable-cell-1-content"><span>已释放</span></div>
                                </th>
                                    <th data-field="publistTime" data-unresize="true">
                                        <div class="layui-table-cell laytable-cell-1-content"><span>已冻结</span></div>
                                    </th>
                                <th data-field="publistTime" data-unresize="true">
                                    <div class="layui-table-cell laytable-cell-1-content"><span>已回购</span></div>
                                </th>
                                <th data-field="publistTime" data-unresize="true">
                                    <div class="layui-table-cell laytable-cell-1-content"><span>已交易</span></div>
                                </th>
                                <th data-field="publistTime" data-unresize="true">
                                    <div class="layui-table-cell laytable-cell-1-content"><span>今日交易</span></div>
                                </th>
                                <th data-field="publistTime" data-unresize="true">
                                    <div class="layui-table-cell laytable-cell-1-publistTime"><span>创建时间</span></div>
                                </th>
                                <th data-field="9">
                                    <div class="layui-table-cell laytable-cell-1-content" align="center"><span>操作</span></div>
                                </th>
                            </tr>
                            </thead>
                            <tbody id="anList">
                            </tbody>
                        </table>
                        <div class="box-tools pull-right">
                            <ul class="pagination" id="pagination_ul">
                            </ul>
                        </div>

    </div>
</div>
</body>
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/layui/layui.js"></script>
<script type="text/javascript" src="/static/js/tools.js"></script>
<script type="text/javascript" src="/static/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/static/js/CodeConst.js"></script>
<script type="text/javascript" src="http://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js"></script>
<script type="text/javascript" src="/static/js/oss.js"></script>
<script type="text/javascript" src="/static/js/common.js"></script>
<script>

    function changeTotalDealCount(a) {
        var coinTypeId = a.id;
        coinTypeId = coinTypeId.split(":")[1];
        var count = prompt("请输入总交易量");
        console.log(count);
        $.get("/back/dealparam/cointype/changeTotalDealCount?coinTypeId="+coinTypeId+"&count=" + count, function (data) {
            document.getElementById("totalDealCount:"+coinTypeId).innerHTML = (count);
            // init();
        });
    }

    function changeTodayDealCount(a) {
        var coinTypeId = a.id;
        coinTypeId = coinTypeId.split(":")[1];
        var count = prompt("请输入今日交易量");
        console.log(count);
        $.get("/back/dealparam/cointype/changeTodayDealCount?coinTypeId="+coinTypeId+"&count=" + count, function (data) {
            document.getElementById("todayDealCount:"+coinTypeId).innerHTML = (count);
            // init();
        });
    }

    function changeCoinPrice(a) {
        var coinTypeId = a.id;
        coinTypeId = coinTypeId.split(":")[1];
        var price = prompt("请输入货币价格");
        console.log(price);
        $.get("/back/dealparam/cointype/changeCoinPrice?coinTypeId="+coinTypeId+"&price=" + price, function (data) {
            printJson("请求成功");
            printJson("货币价格:"+price);
            var aa = "cp:"+coinTypeId;
            printJson(aa);
            document.getElementById(aa).innerHTML = price;
        });
    }

    //遍历baseDto
    function loadData(baseDto) {
        if (baseDto.code == ERROR)
            console.log(baseDto.msg);
        else {
            //数据
            var data = baseDto.data.list;
            var text = "";
            <!-- 编号、货币图标、货币名称、货币单价、已配发、已激活、已释放、已冻结、已回购、已交易、今日交易、创建时间、操作 -->
            $.each(data, function (index, coin) {
                 text += "<tr>\n" +
                        "<td>" + coin.coinType.id+ "</td>\n" +
                        "<td> <img src = '" + coin.coinType.iconUrl + "' /></td>\n" +
                        "<td>" + coin.coinType.name + "</td>\n" +
                        "<td id=\"cp:"+coin.coinType.id+"\">" + coin.coinPrice + "</td>\n" +
                        "<td>" + coin.grantCount + "</td>\n" +
                        "<td>" + coin.aliveCoinActivateCount + "</td>\n" +
                        "<td>" + coin.releaseCount + "</td>\n" +
                        "<td>" + coin.frozenCount + "</td>\n" +
                        "<td>" + coin.buyBackCount + "</td>\n" +
                        "<td id='totalDealCount:"+coin.coinType.id+"'>" + coin.totalDealCount + "</td>\n" +
                        "<td id='todayDealCount:"+coin.coinType.id+"'>" + coin.todayDealCount + "</td>\n" +
                        "<td>" + coin.coinType.createTime + "</td>\n" +
                        "<td class=\"text-center\" align=\"center\">\n" +
                        "    <a id='a:"+coin.coinType.id+"' href='#' onclick='changeTotalDealCount(this)'   type=\"button\" class=\"layui-btn layui-btn-xs\">修改总交易量</a>\n" +
                        "    <a id='b:"+coin.coinType.id+"' href='#' onclick='changeTodayDealCount(this)'   type=\"button\" class=\"layui-btn layui-btn-xs\">修改今日交易量</a>\n" +
                        "    <a id='c:"+coin.coinType.id+"' href='#' onclick='changeCoinPrice(this)'   type=\"button\" class=\"layui-btn layui-btn-xs\">修改货币价格</a>\n" +
                        "    <a href='/back/dealparam/cointype/del?coinTypeId=" + coin.coinType.id + "'        type=\"button\" class=\"layui-btn layui-btn-xs\">删除</a>\n" +
                        "</td>\n" +
                        "</tr>";
            });
            var anListDom = $("#anList");
            anListDom.empty();//清空子元素
            anListDom.append($(text));
//            var pages = baseDto.data.pages;
//            var pageNum = baseDto.data.pageNum;
//            console.log("pageNum="+pageNum);
//            var btnList = "";
//            btnList += "<li class='first_page'><a onclick='loadPage(this)' link='/back/dealparam/cointype/listpage'>"+"首页"+"</a></li>";
//            var temp = "<li class='prepage'><a onclick='loadPage(this)' link='/back/dealparam/cointype/listpage?pageNum=" + (pageNum - 1) + "'>上一页</a></li>";
//            console.log("temp="+temp);
//            btnList += temp;
//            for (var i = 0; i < pages; i++) {
//                btnList += ("<li class='prepage'><a onclick='loadPage(this)' link='/back/dealparam/cointype/listpage?pageNum=" + (i+1) + "'>"+(i+1)+"</a></li>\n")
//            }
//            btnList +=("<li class='nextpage'><a onclick='loadPage(this)' link='/back/dealparam/cointype/listpage?pageNum=" + (pageNum + 1) + "'>下一页</a></li>\n" +
//                    "<li class='last_page' ><a onclick='loadPage(this)' link='/back/dealparam/cointype/listpage?pageNum=" + pages + "'>末页</a></li>");
//            console.log(btnList);
//            var pagination_ul = $("#pagination_ul");
//            pagination_ul.empty();
//            pagination_ul.append(btnList);

        }
    }

    function loadPage(a)
    {
        var a_jquery = $(a);
        var url = a_jquery.attr("link");
        $.ajax(
                {
                    url: url,
                    type: "GET",
                    success: function (baseDto) {
                        loadData(baseDto);
                    }
                }
        );
    }

    //获取数据
    $.ajax({
        url: "/back/dealparam/cointype/list",
        type: "GET",
        success: function (baseDto) {
            loadData(baseDto);
            layui.use("laypage",function () {
                laypage = layui.laypage;
                baseDto = baseDto.data;
                laypage.render({
                    elem: 'pagination_ul'
                    ,count: baseDto.total
                    ,curr: baseDto.fristPage //获取起始页
                    ,limit: 10
                    ,jump: function (obj) {
                        loadPage(obj.curr);
                    }

                });
            });

        }
    });

</script>


</html>